package org.jeecg.glr.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.glr.entity.GlrColumn;
import org.jeecg.glr.entity.GlrLed;
import org.jeecg.glr.entity.GlrResource;

import java.util.List;

/**
 * @Description: 栏目内容
 * @Author: jeecg-boot
 * @Date:   2020-02-24
 * @Version: V1.0
 */
public interface GlrColumnMapper extends BaseMapper<GlrColumn> {
    @Select("select code,width,height,status,sys_company_code from glr_led where id in ( select member_Id from glr_led_menber where column_id=#{columnId}  and member_type='1')")
    List<GlrLed> getGlrLedByColunmId(String columnId);

    @Select("select t.id,t.file_path,t.file_Name,t.file_Id,t.file_Size,t.file_play_time,t.file_Type,t.file_Md5 from glr_resource t ,glr_led_menber b where t.id=b.member_Id and b.column_id=#{columnId} order by b.order_code desc")
    List<GlrResource> getGlrLedResourceByColunmId(String columnId);

    @Select("select code from glr_led where id in (select member_Id from glr_led_menber where column_id=#{id} and member_type='1')")
    List<GlrLed> getLedCodeByCommonId(String id);


}
